package com.blast.comicsisland.model.recommend.recommendbody;

import org.json.JSONException;
import org.json.JSONObject;

import kale.adapter.AdapterModel;

/**
 * Created by dell on 2015/6/24.
 */
public class ComicsList implements AdapterModel{
    public boolean isHeader;
    //字段名称 subject_name 漫画的类型
    private String subjectName;
    private String progresstype;
    //漫画的名称 字段为bigbook_name 需要写入db
    private String bigbookName;

    //漫画的id 字段名称 bigbook_id;需要写入db
    private String bigbookId;
    //字段名称 keyName; 漫画关键字
    private String keyName;
    //漫画作者 字段名称 bigbook_author
    private String bigbookAuthor;
    //浏览次数
    private String bigbookview;
    //预览图片 可把地址写入db
    private String coverurl;

    public String getSubjectName() {
        return subjectName;
    }

    public void setSubjectName(String subjectName) {
        this.subjectName = subjectName;
    }

    public String getProgresstype() {
        return progresstype;
    }

    public void setProgresstype(String progresstype) {
        this.progresstype = progresstype;
    }

    public String getBigbookName() {
        return bigbookName;
    }

    public void setBigbookName(String bigbookName) {
        this.bigbookName = bigbookName;
    }

    public String getBigbookId() {
        return bigbookId;
    }

    public void setBigbookId(String bigbookId) {
        this.bigbookId = bigbookId;
    }

    public String getKeyName() {
        return keyName;
    }

    public void setKeyName(String keyName) {
        this.keyName = keyName;
    }

    public String getBigbookAuthor() {
        return bigbookAuthor;
    }

    public void setBigbookAuthor(String bigbookAuthor) {
        this.bigbookAuthor = bigbookAuthor;
    }

    public String getBigbookview() {
        return bigbookview;
    }

    public void setBigbookview(String bigbookview) {
        this.bigbookview = bigbookview;
    }

    public String getCoverurl() {
        return coverurl;
    }

    public void setCoverurl(String coverurl) {
        this.coverurl = coverurl;
    }

    @Override
    public int getDataTypeCount() {
        return 1;
    }

    @Override
    public Object getDataType() {
        return 1;
    }

    //------------------------------>
    //解析部分
    /**
     * "comicsList": [ {
     "subject_name": "搞笑",
     "progresstype": 1,
     "bigbook_name": "内涵漫画",
     "bigbook_id": 13885,
     "key_name": "冒险,动作,热⾎血,格⽃斗,少年,⿊黑⽩白",
     "bigbook_author": "你懂的",
     "bigbookview": 7934058,
     "coverurl": "http://mhd.1391.com/book/4fm/13885.jpg" },
     */
    public void jsonParse(JSONObject object) {
        try {
            bigbookName = object.getString("bigbook_name");
            bigbookId = String.valueOf(object.getInt("bigbook_id"));
            bigbookAuthor = object.getString("bigbook_author");
            bigbookview = String.valueOf(object.getInt("bigbookview"));
            coverurl = object.getString("coverurl");
        } catch (JSONException e) {
            e.printStackTrace();
        }
    }
}
